<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="xml" version="1.0" encoding="utf-8" indent="yes"/>

	<xsl:template match="/">
		<releaseNote xmlns="http://www.telerik.com/importReleaseNotesSchema.xsd">
			<items>
				<xsl:for-each select="controls/control">
					<xsl:if test="stories/story or bugs/bug">
						<releaseNoteItem Title="{area}">
							
							<xsl:if test="stories/story">
								<newItems>
									<xsl:for-each select="stories/story">
										<add>
											<xsl:value-of select="."/>
										</add>
									</xsl:for-each>
								</newItems>
							</xsl:if>

							<xsl:if test="bugs/bug">
								<fixedItems>
									<xsl:for-each select="bugs/bug">
										<add>
											<xsl:value-of select="."/>
										</add>
									</xsl:for-each>
								</fixedItems>
							</xsl:if>
						</releaseNoteItem>
					</xsl:if>
				</xsl:for-each>
			</items>
		</releaseNote>
	</xsl:template>
</xsl:stylesheet>